<?php

  /**
   * This class implement all methods and properties on a folder.<br />
   * Store the folder name in private private variable for further use.<br />
   *
   * @author Dany Mottier
   * @version 4
   */
  interface IFolder {

    /**
     * Change directory.<br />
     * Changes PHP's current directory to directory.<br />
     *
     * @param string $directory The new current directory.
     *
     * @return IBoolean TRUE on success or FALSE on failure.<br /><br />
     *
     * @link http://be.php.net/manual/en/function.is-string.php
     * @link http://be2.php.net/manual/en/function.chdir.php
     */
    function change($directory);

    /**
     * Change the root directory.<br />
     * Changes the root directory of the current process to directory. This
     * function is only available if your system supports it and you're using
     * the CLI, CGI or Embed SAPI. Also, this function requires root privileges.<br />
     *
     * @param string $directory The new current directory.
     *
     * @return IBoolean TRUE on success or FALSE on failure.<br /><br />
     *
     * @link http://be.php.net/manual/en/function.is-string.php
     * @link http://be2.php.net/manual/en/function.chroot.php
     */
    function changeRoot($directory);

    /**
     * Close directory handle.<br />
     * Closes the directory stream indicated by handle. The stream must have
     * previously been opened by Open().<br />
     *
     * @link http://be2.php.net/manual/en/function.closedir.php
     */
    function close();

    /**
     * Gets the current working directory.<br />
     *
     * @return string The current working directory on success, or FALSE on
     * failure.<br /><br />
     *
     * @link http://be2.php.net/manual/en/function.getcwd.php
     */
    function getCurrent();

    /**
     * Returns the name of the directory to work with.<br />
     *
     * @return string The name of the directory as a string.
     */
    function getName();

    /**
     * Open the directory handle.<br />
     * Opens up a directory handle to be used in subsequent Close(), Read(), and
     * Rewind() calls.<br />
     *
     * @return IBoolean TRUE on success or FALSE on failure.
     *
     * @link http://be.php.net/manual/en/function.opendir.php
     */
    function open();

    /**
     * Read entry from directory handle.<br />
     * Returns the filename of the next file from the directory. The filenames
     * are returned in the order in which they are stored by the filesystem.<br />
     *
     * @return mixed The filename on success, or FALSE on failure.<br /><br />
     *
     * @link http://be2.php.net/manual/en/function.readdir.php
     */
    function read();

    /**
     * Rewind directory handle.<br />
     * Resets the directory stream indicated by dir_handle to the beginning of
     * the directory.<br />
     *
     * @link http://be2.php.net/manual/en/function.rewinddir.php
     */
    function rewind();

    /**
     * Add each file or folder to his appropriate collection.<br />
     *
     * @link http://be2.php.net/manual/en/function.is-file.php
     */
    function scan();
  }

?>
